import Http from '../http';

export async function chargeLogApi(queryParams : Pagination) {
    let res = await Http.get('chargeOrder/page', queryParams)
    return res.data ? res.data : []
}

export function queryChargeLogByOrderIdApi(orderId:string|number) {
    return Http.get('chargeOrder/order/' + orderId)
}

export async function queryChargeLogPowerApi(orderId:string|number) {
    const { data } = await Http.get('chargeOrder/power/' + orderId)
    return data
}

export async function queryAllChargingOrderApi() :Promise<ChargingOrder[]>{
    const { data } = await Http.get('chargeOrder/charging')
    return data
}

export async function querySingleChargingApi(orderId:number) :Promise<ChargingOrder>{
    const { data } = await Http.get('chargeOrder/charging?orderId=' + orderId)
    return data
}